<?php
$tb = $this->config->TABLE_PREFIX;
$pid = $this->get('paged') > 0 ? $this->get('paged') : 1;
$limit = 20;
$offset = $limit * ($pid - 1);
$_stats = $this->db->fetch_all("SELECT * FROM `{$tb}statistics` ORDER BY `date` ASC LIMIT $offset, $limit");

$pager = new cmsdream_pager($this->get_paged_link(), $pid);
$pager->setPagesize($limit);
$pager->setTotal($this->db->fetch_field("SELECT COUNT(*) FROM {$tb}statistics"));

$this->hash = md5($this->hash);
if($this->get('hash','')==$this->hash) {
	$p = $this->get_page_params(array());
	$name = isset($p['statistics']) ? $p['statistics'] : 'traffic';
	header("Content-Type:text/xml; charset=utf-8");
	$this->template = "chart/$name";
}
